<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"           
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      >
    <h:head>
        <f:metadata>
            <f:viewParam name="sessionID" value="#{sessionBean.sessionID}"/>
            <f:event type="preRenderView" listener="#{sessionBean.getSessionDetail}"/>
        </f:metadata>           
    </h:head>
    <h:body>
        <ui:composition template="template/masterlayout.xhtml">
            <ui:define name="pagetitle">
                Session Detail
            </ui:define>
            <ui:define name="breadcrumb">
                <h:link value="Dashboard" outcome="index"/> &raquo; 
                <h:link value="#{sessionBean.patientName}" outcome="patient"><f:param name="patientID" value="#{sessionBean.patientID}"/></h:link> &raquo; 
                Session detail
            </ui:define>
            <ui:define name="content">
                <div class="druginfo detail">
                <p>
                    <h:outputLabel for="patientName">Patient Name: </h:outputLabel>
                    <h:outputText id="patientName" value="#{sessionBean.patientName}"/>
                </p>    
                <p>
                    <h:outputLabel for="sessionDate">Date: </h:outputLabel>
                    <h:outputText id="sessionDate" value="#{sessionBean.sessionDate}"/>
                </p>
                <p>
                    <h:outputLabel for="doctor">Doctor: </h:outputLabel>
                    <h:outputText id="doctor" value="${sessionBean.doctor}"/>
                </p>
                <p>
                    <h:outputLabel for="require">Require: </h:outputLabel>
                    <h:outputText id="require" value="#{sessionBean.require}"/>
                </p>    
                <p>
                    <h:outputLabel for="diagnostic">Diagnostic: </h:outputLabel>
                    <h:outputText id="diagnostic" value="#{sessionBean.diagnostic}"/>
                </p>
                <div class="drugs">
                    <h3>Drugs:</h3>
                    <h:dataTable value="#{sessionBean.drugsOfSession}" var="drug">
                        <h:column>
                            <f:facet name="header">Drug Name</f:facet>
                            #{drug.drugName}
                        </h:column>
                        <h:column>
                            <f:facet name="header">Price</f:facet>
                            #{drug.drugPrice} $
                        </h:column>
                    </h:dataTable>
                </div>
                <div class="services">
                    <h3>Services:</h3>
                    <h:dataTable value="#{sessionBean.serviceOfSession}" var="service">
                        <h:column>
                            <f:facet name="header">Service Name</f:facet>
                            #{service.serviceName}
                        </h:column>
                        <h:column>
                            <f:facet name="header">Price</f:facet>
                            #{service.servicePrice} $
                        </h:column>
                    </h:dataTable>
                </div>                    
                </div>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

